package cn.yunhe.action;

import cn.yunhe.pojo.Book;
import cn.yunhe.service.BookService;
import cn.yunhe.util.BaseAction;

import java.util.List;

public class QueryBookAction extends BaseAction {
    private String radioValue;
    private String keywords;

    private List<Book> list;

    BookService bookService=new BookService();

  /*  @Override
    public String execute() throws Exception {
        if (radioValue.equals("bname")){
             list=bookService.queryByBname(keywords);
        }else if (radioValue.equals("bauthor")){
             list=bookService.queryByBauthor(keywords);
        }else if (radioValue.equals("bpress")){
             list=bookService.queryByBpress(keywords);
        }

        return super.execute();
    }*/

    public String queryByBname(){
        System.out.println("<===radioValue1====>"+radioValue);
         list=bookService.queryByBname(keywords);
        /*getMap2Request().put("list",list);*/
        return SUCCESS;
    }
    public String queryByBauthor(){
        System.out.println("<===radioValue2====>"+radioValue);
         list=bookService.queryByBauthor(keywords);
        /*getMap2Request().put("list",list);*/
        return SUCCESS;
    }
    public String queryByBpress(){
        System.out.println("<===radioValue3====>"+radioValue);
         list=bookService.queryByBpress(keywords);
        /*getMap2Request().put("list",list);*/
        return SUCCESS;
    }


    public String getRadioValue() {
        return radioValue;
    }

    public void setRadioValue(String radioValue) {
        this.radioValue = radioValue;
    }

    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    public List<Book> getList() {
        return list;
    }

    public void setList(List<Book> list) {
        this.list = list;
    }
}
